{#- 寄存器地址表 -#}
{%- if (table.regions.input_coils | length) > 0 %}
/*
 * 输入线圈地址映射表
 */
const static agile_modbus_slave_util_map_t _{{ slave_name | string | lower }}_input_coils_util_map[{{ table.regions.input_coils | length }}] = 
{   {% for region in table.regions.input_coils %}
    { .start_addr={{ region.start }}, .end_addr={{ region.end }}, .get=_{{ slave_name | string | lower }}_get_input_coils, .set=NULL },{% endfor %}
};
{% endif -%}
{%- if (table.regions.holding_coils | length) > 0 %}
/*
 * 保持线圈地址映射表
 */
const static agile_modbus_slave_util_map_t _{{ slave_name | string | lower }}_holding_coils_util_map[{{ table.regions.holding_coils | length }}] = 
{   {% for region in table.regions.holding_coils %}
    { .start_addr={{ region.start }}, .end_addr={{ region.end }}, .get=_{{ slave_name | string | lower }}_get_holding_coils, .set=_{{ slave_name | string | lower }}_set_holding_coils },{% endfor %}
};
{% endif -%}
{%- if (table.regions.input_registers | length) > 0 %}
/*
 * 输入寄存器地址映射表
 */
const static agile_modbus_slave_util_map_t _{{ slave_name | string | lower }}_input_registers_util_map[{{ table.regions.input_registers | length }}] = 
{   {% for region in table.regions.input_registers %}
    { .start_addr={{ region.start }}, .end_addr={{ region.end }}, .get=_{{ slave_name | string | lower }}_get_input_registers, .set=NULL },{% endfor %}
};
{% endif -%}
{%- if (table.regions.holding_registers | length) > 0 %}
/*
 * 保持寄存器地址映射表
 */
const static agile_modbus_slave_util_map_t _{{ slave_name | string | lower }}_holding_registers_util_map[{{ table.regions.holding_registers | length }}] = 
{   {% for region in table.regions.holding_registers %}
    { .start_addr={{ region.start }}, .end_addr={{ region.end }}, .get=_{{ slave_name | string | lower }}_get_holding_registers, .set=_{{ slave_name | string | lower }}_set_holding_registers },{% endfor %}
};
{% endif %}
const agile_modbus_slave_util_t _{{ slave_name | string | lower }}_util = 
{
    {% if (table.regions.holding_coils | length) > 0 -%}
    .tab_bits=_{{ slave_name | string | lower }}_holding_coils_util_map,
    {%- else -%}
    .tab_bits=NULL,
    {%- endif %}
    .nb_bits={{ table.regions.holding_coils | length }},
    {% if (table.regions.input_coils | length) > 0 -%}
    .tab_input_bits=_{{ slave_name | string | lower }}_input_coils_util_map,
    {%- else -%}
    .tab_input_bits=NULL,
    {%- endif %}
    .nb_input_bits={{ table.regions.input_coils | length }},
    {% if (table.regions.holding_registers | length) > 0 -%}
    .tab_registers=_{{ slave_name | string | lower }}_holding_registers_util_map,
    {%- else -%}
    .tab_registers=NULL,
    {%- endif %}
    .nb_registers={{ table.regions.holding_registers | length }},
    {% if (table.regions.input_registers | length) > 0 -%}
    .tab_input_registers=_{{ slave_name | string | lower }}_input_registers_util_map,
    {%- else -%}
    .tab_input_registers=NULL,
    {%- endif %}
    .nb_input_registers={{ table.regions.input_registers | length }},
    .addr_check=NULL,
    .special_function=NULL,
    .done=NULL
};